#pragma once
#include <cmath>
/// 初始条件函数,且 u(0,t) = u(1,t) = 0
double u0(double x)
{
    if (x >= 0.45)
    {
	if (x < 0.5)
	    return 20*(x - 0.45);
	else if (x < 0.55)
	    return 20*(0.55 - x);
	else
	    return 0;
    }
    return 0;
};

/// the initial of advection equation u_t + u_x = 0 
double u1(double x)
{
    return exp(-20*(x-2)*(x-2)) + exp(-(x-5)*(x-5));
};
